﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Naruto.TaskManagement.Application;
using Naruto.TaskManagement.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Naruto.TaskManagement.WebApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ChatSessionStateController : ControllerBase
    {
        private readonly ChatSessionStateApps chatSessionStateApps;

        public ChatSessionStateController(ChatSessionStateApps _chatSessionStateApps)
        {
            chatSessionStateApps = _chatSessionStateApps;
        }
        /// <summary>
        /// 获取我的会话状态
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        [HttpGet("{userId}")]
        public async Task<NarutoResult> GetListByUserId(string userId)
        => await chatSessionStateApps.GetListByUserId(userId);
        [HttpDelete("{id}")]
        /// <summary>
        /// 根据id删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<NarutoResult> DeleteById(string id) => await chatSessionStateApps.DeleteById(id);
    }
}
